<%@ tag language="java" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ attribute name="address" type="java.lang.String" required="true" rtexprvalue="true" %>
<%@ attribute name="width" type="java.lang.String" required="true" %>
<%@ attribute name="height" type="java.lang.String" required="true" %>
<script type="text/javascript">
$(function() {
    var map = new google.maps.Map(document.getElementById('maptag_canvas'), {
        zoom: 16,
        center: new google.maps.LatLng(36,138),
        mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    var address = '${address}';
    var geocoder = new google.maps.Geocoder();
    geocoder.geocode({
        address: address
    }, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
            map.setCenter(results[0].geometry.location);
            var marker = new google.maps.Marker({
                map: map,
                position: results[0].geometry.location
            });
        }
    });
});
</script>
<div id="maptag_canvas" style="width: ${width}px; height: ${height}px; border: 1px solid #ccc;"></div>
